package com.superme.service;

import com.superme.entity.PersonEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Sort;

import java.sql.Timestamp;

public interface ExampleService {
    /*
        根据查询条件查询相关数据
   */
    Page<PersonEntity> findallByCondition(String name, String nickName, int pageNum, int pageSize, Sort.Direction sd, String orderProprtties);

    Page<PersonEntity> findallBySearchText(String searchText,  int pageNum, int pageSize, Sort.Direction sd, String sortName);

    /*
        根据ID获取对象
    */
    PersonEntity findByID(int id);

    /*
        新增相关信息
    */
    PersonEntity addPerson(String name, String nickName, Integer age, String date, Integer height);
    PersonEntity addPerson(String name, String nickName, Integer age, Timestamp date, Integer height);

    /*
        更新保存相关信息
    */
    PersonEntity savePerson(int id, String name, String nickName, Integer age, String date, Integer height);

    PersonEntity savePerson(int id, String name, String nickName, Integer age, Timestamp date, Integer height);

    /*
        删除相关信息
    */
    boolean deletePerson(int id);
}
